home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 March / EnterCD 03_2004.iso / Multimedia / Adobe GoLive CS / data1.cab / PF_AppDir_Help / Help / Version_Cue / help.js < prev    next >
Encoding:
Text File  |  2003-12-10  |  39.6 KB  |  1,203 lines

  1. <!--[CDATA[
  2.  
  3. var upperAsciiXlatTbl = new Array(
  4. 223,"ss",
  5. 230,"ae",
  6. 198,"ae",
  7. 156,"oe",
  8. 140,"oe",
  9. 240,"eth",
  10. 208,"eth",
  11. 141,"y",
  12. 159,"y"
  13. );
  14.  
  15. var maxNumberOfShownSearchHits = 100;
  16. var showInputStringAlerts = 0;
  17. var navigationCookie = "";
  18.  
  19. /*
  20.  * This function parses comma-separated name=value 
  21.  * argument pairs from the query string of the URL. 
  22.  * It stores the name=value pairs in 
  23.  * properties of an object and returns that object.
  24.  */
  25. function getArgs() 
  26. {
  27.     var args = new Object();
  28.     var query = top.location.search.substring(1);   
  29.     // Get query string
  30.     var pairs = query.split(",");
  31.     // Break at comma
  32.     for(var i = 0; i < pairs.length; i++) 
  33.     {
  34.         var pos = pairs[i].indexOf('=');
  35.           // Look for "name=value"
  36.         if (pos == -1) continue;
  37.           // If not found, skip
  38.         var argname = pairs[i].substring(0,pos);
  39.           // Extract the name
  40.         var value = pairs[i].substring(pos+1);
  41.           // Extract the value
  42.         args[argname] = unescape(value);
  43.             // Store as a property
  44.           // In JavaScript 1.5, use decodeURIComponent(  ) 
  45.           // instead of escape(  )
  46.     }
  47.     return args;     // Return the object
  48. }
  49.  
  50. /////////////////////////////// COOKIE-RELATED FUNCTIONS ////////////////////////
  51. // Bill Dortch getCookieVal and GetCookie routines
  52. function getCookieVal(offset) {
  53.   var endstr=document.cookie.indexOf(";",offset);
  54.   if (endstr==-1)endstr=document.cookie.length;
  55.   return unescape(document.cookie.substring(offset, endstr));
  56. }
  57. function GetCookie(name) {
  58.   if (is_safari)
  59.   {
  60.         var args = getArgs();
  61.         if (args[name].length > 0) 
  62.         {
  63.             return args[name];
  64.         }
  65.   }
  66.   var arg=name+"=";
  67.   var alen=arg.length;
  68.   var clen=document.cookie.length;
  69.   var i=0;
  70.   while(i<clen){
  71.     var j=i+alen;
  72.     if(document.cookie.substring(i,j)==arg)return getCookieVal(j);
  73.     i=document.cookie.indexOf(" ",i)+1;
  74.     if(i==0)break; 
  75.   }
  76.   return null;
  77. }
  78. function getTopCookieVal(offset) {
  79.   var endstr=top.document.cookie.indexOf(";",offset);
  80.   if (endstr==-1)endstr=top.document.cookie.length;
  81.   return unescape(top.document.cookie.substring(offset, endstr));
  82. }
  83. function GetTopCookie(name) {
  84.   var arg=name+"=";
  85.   var alen=arg.length;
  86.   var clen=top.document.cookie.length;
  87.   var i=0;
  88.   while(i<clen){
  89.     var j=i+alen;
  90.     if(top.document.cookie.substring(i,j)==arg)return getTopCookieVal(j);
  91.     i=top.document.cookie.indexOf(" ",i)+1;
  92.     if(i==0)break; 
  93.   }
  94.   return null;
  95. }
  96. // SetCookie
  97. // -----------
  98. // This function is called to set a cookie in the current document.
  99. //  params:
  100. //        n - name of the cookie
  101. //        v - value of the cookie
  102. //        minutes - the duration of the cookie in minutes (that is, how many minutes before it expires)
  103. function SetCookie(n,v,minutes) {
  104.  var Then = new Date();
  105.  Then.setTime(Then.getTime() + minutes * 60 * 1000);
  106.  document.cookie = n + "=" + v + ";expires=" + Then.toGMTString();
  107. }
  108. // getContentCookie
  109. // ----------------
  110. // This function reads the content cookie set by the handleContext funtion.
  111. //
  112. function getContentCookie()
  113. {
  114.     var contentCookie = GetCookie("content");
  115.     top.document.cookie = "content=";
  116.  
  117.     // What does this expression mean?
  118.     // (contentCookie.indexOf("htm") != -1)
  119.     if ( (contentCookie != null) && (contentCookie.indexOf("htm") != -1) ) 
  120.     {
  121.         document.cookie = "content="; // Wipe out the cookie
  122.         top.document.cookie = "histR=" + contentCookie;
  123.         location.replace(contentCookie);
  124.     }            
  125. }
  126. // getNavigationCookie
  127. // -------------------
  128. // This function reads the content cookie set by the handleContext funtion.
  129. //
  130. function getNavigationCookie()
  131. {
  132.     navigationCookie = GetCookie("navigation");
  133.     top.document.cookie = "navigation=";
  134.  
  135.     // What does this expression mean?
  136.     // (navigationCookie.indexOf("htm") != -1)
  137.     if ( (navigationCookie != null) && (navigationCookie.indexOf("htm") != -1) ) 
  138.     {
  139.         document.cookie = "navigation="; // Wipe out the cookie
  140.         top.document.cookie = "histL=" + navigationCookie;
  141.         location.replace(navigationCookie);
  142.     }
  143.                 
  144. }
  145.  
  146. // handleContext
  147. // -------------
  148. // This function is called from content pages. It sets a cookie as soon
  149. // as the page is loaded. If the content page is not in it's proper place
  150. // in the frameset, the frameset will be loaded and the page will be 
  151. // restored using the value in this cookie.
  152. //
  153. function handleContext(which)
  154. {
  155.     var docLocLastNode = lastNodeOf(document.location);
  156.  
  157.     if( top.frames.length ) {
  158.         
  159.         if( which ) {    // This page is supposed to go into the CONTENT frame
  160.             if( docLocLastNode != lastNodeOf(top.frames["content"].location) ) {    // ...but it is being loaded elsewhere
  161.                 if (is_safari)
  162.                 {
  163.                     top.location.replace("help.html?content=" + docLocLastNode);
  164.                 }
  165.                 top.location.replace("help.html");
  166.                 top.document.cookie = "content=" + docLocLastNode;
  167.             }
  168.             else {
  169.                 top.document.cookie = "histR=" + docLocLastNode;
  170.             }
  171.         }
  172.         else {            // This page is supposed to go into the NAVIGATION frame
  173.             if( docLocLastNode != lastNodeOf(top.frames["navigation"].location) ) {    // ...but it is being loaded elsewhere
  174.                 top.location.replace("help.html");
  175.                 top.document.cookie = "navigation=" + lastNodeOf(top.frames["content"].history.previous);
  176.             }
  177.             else {
  178.                 top.document.cookie = "histL=" + docLocLastNode;
  179.             }
  180.         }
  181.     }
  182.     else {
  183.         if( which ) {
  184.             top.document.cookie = "navigation=1_0_0_0.html";
  185.             top.document.cookie = "histL=1_0_0_0.html";
  186.             top.document.cookie = "content=" + docLocLastNode;
  187.             top.document.cookie = "histR=" + docLocLastNode;
  188.             if (is_safari)
  189.             {
  190.                 top.location.replace("help.html?content=" + docLocLastNode);
  191.             }
  192.         }
  193.         else {
  194.             top.document.cookie = "navigation=" + docLocLastNode;
  195.             top.document.cookie = "histL=" + docLocLastNode;
  196.             top.document.cookie = "content=splash.html";
  197.             top.document.cookie = "histR=splash.html";
  198.         }
  199.         top.location.replace("help.html");
  200.     }
  201. }
  202. // lastNodeOf
  203. // ----------
  204. // This function gets passed a URL and returns the last node of same.
  205. function lastNodeOf(e)
  206. {
  207.     var expr = "" + e;
  208.     var pos = expr.lastIndexOf("/");
  209.  
  210.     if( (pos != -1) && (pos+1 != expr.length) ) {
  211.         return expr.substr(pos+1);
  212.     }
  213.     else {
  214.         return expr;
  215.     }
  216. }
  217. // frameBuster
  218. // -----------
  219. // This function is called by the frameset to ensure it's always loaded
  220. // at the top level of the current window.
  221. //
  222. function frameBuster()
  223. {
  224.     var thisLocation = document.location;
  225.     if ( document.location != top.location )
  226.     {
  227.         top.location.replace("help.html");
  228.     }
  229. }
  230.  
  231.  
  232. // SEARCH RELATED.......................................SEARCH RELATED
  233. // SEARCH RELATED.......................................SEARCH RELATED
  234. // SEARCH RELATED.......................................SEARCH RELATED
  235. // SEARCH RELATED.......................................SEARCH RELATED
  236. // SEARCH RELATED.......................................SEARCH RELATED
  237. // SEARCH RELATED.......................................SEARCH RELATED
  238. // SEARCH RELATED.......................................SEARCH RELATED
  239. // SEARCH RELATED.......................................SEARCH RELATED
  240. // SEARCH RELATED.......................................SEARCH RELATED
  241. // SEARCH RELATED.......................................SEARCH RELATED
  242. function bubbleSortWithShadow(a,b)
  243. {
  244.     var temp;
  245.     for(var j=1; j<a.length; j++) {
  246.         for(var i=0; i<j; i++) {
  247.             if( a[i] < a[j] ) {    
  248.                 temp = a[j];a[j] = a[i];a[i] = temp;
  249.                 temp = b[j];b[j] = b[i];b[i] = temp;
  250.             }
  251.         }
  252.     }
  253. }
  254. //---------------------------------------------------
  255. function buildHtmlResultsStr()
  256. {
  257.     var innerHTMLstring,ndxEnd;
  258.  
  259.     // Gather all of the results display lines into the 'resultsArr'
  260.         ndxEnd = (matchesArrIndices.length > maxNumberOfShownSearchHits ) ? maxNumberOfShownSearchHits : matchesArrIndices.length;
  261.  
  262.         for(var ndx=0, resultsArr = new Array(); ndx < ndxEnd; ndx++) {
  263.             resultsArr[resultsArr.length] = buildResultsStrOneLine(matchesArrIndices[ndx],matchesArrHits[ndx]);
  264.         }
  265.  
  266.     // Convert this 'resultsArr' into a single string that will be injected into this search page.
  267.         innerHTMLstring = "";
  268.         for( var ndx=0; ndx < resultsArr.length; ndx++ ) {
  269.             innerHTMLstring = innerHTMLstring + resultsArr[ndx];
  270.         }
  271.     return innerHTMLstring;
  272. }
  273. //---------------------------------------------------
  274. function buildResultsStrOneLine(a,b)
  275. {
  276.     var retStr;
  277.     retStr = "<p class=\"searchresults\"><a href=\"" + top.fileArr[a] + ".html\"";
  278.  
  279.     // for debug...
  280.     //retStr += "target=\"content\" ";
  281.     //retStr += "title=\"" + top.fileArr[a] + ".html-";
  282.     //retStr += a + "-" + b + "\">";
  283.  
  284.     // for production...
  285.     retStr += "target=\"content\" >";
  286.  
  287.     retStr += top.titleArr[a] + "</a></p>";
  288.     return retStr;
  289. }
  290. //---------------------------------------------------
  291. // checkForHits
  292. //  Break up the search term into words.
  293. //  Check each of those words against...
  294. //        (a) cached titles and 
  295. //        (b) cached content lines 
  296. //  Perform the hit detection for each one, 
  297. //  storing the results into (hits-ordered) 
  298. //        'matchesArrIndices' and 
  299. //        'matchesArrHits'.
  300. //---------------------------------------------------
  301. function checkForHits()
  302. {
  303.     var inputWords = new Array();
  304.     var tempArr = new Array();
  305.  
  306.     // Split the search term into individual search words
  307.         tempArr = searchTerm.split(" ");
  308.         for(var ndx=0; ndx < tempArr.length; ndx++) {
  309.             if( tempArr[ndx].length ) {
  310.                 inputWords[inputWords.length] = tempArr[ndx];
  311.             }
  312.         }
  313.  
  314.     // Initialization
  315.         matchesArrHits = new Array();
  316.         matchesArrIndices = new Array();
  317.  
  318.     // Initialize the 'maskArr' and the 'hitsArr'
  319.         maskArr = new Array();
  320.         hitsArr = new Array();
  321.         for( var ndx = 0; ndx < top.fileArr.length; ndx++ ) {maskArr
  322.             maskArr[maskArr.length] = 1;
  323.             hitsArr[hitsArr.length] = 0;
  324.         }
  325.  
  326.     // Do checking for matches on EACH OF THE INPUT WORDS
  327.         for( var ndx = 0; ndx < inputWords.length; ndx++ ) {
  328.  
  329.             // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  330.             if( ! checkForHitsWordAgainstPages( inputWords[ndx] ) ) {
  331.                 return;     // No sense in continuing, match has failed.
  332.             }
  333.             // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  334.  
  335.             for( var ndx2 = 0; ndx2 < hitsArr.length; ndx2++ ) {
  336.                 if( hitsArr[ndx2] == 0 ) {
  337.                     maskArr[ndx2] = 0;
  338.                 }
  339.                 else {
  340.                     if( maskArr[ndx2] != 0 ) {
  341.                         maskArr[ndx2] += hitsArr[ndx2];
  342.                     }
  343.                 }
  344.             }
  345.         }
  346.  
  347.     // From the final 'maskArr', generate 'matchesArrHits' and 'matchesArrIndices'    
  348.         for( var ndx = 0; ndx < maskArr.length; ndx++ ) {
  349.             if( maskArr[ndx] ) {
  350.                 matchesArrHits[matchesArrHits.length] = maskArr[ndx];
  351.                 matchesArrIndices[matchesArrIndices.length] = ndx;
  352.             }
  353.         }
  354.  
  355.     // If there were any hits, then sort them by highest hits first
  356.         if( matchesArrIndices.length ) {
  357.             bubbleSortWithShadow(matchesArrHits, matchesArrIndices);
  358.         }
  359. }
  360. //---------------------------------------------------
  361. function checkForHitsWordAgainstPages(w)        
  362. {
  363.     var hitAnywhere = 0;
  364.  
  365.     // Process each of the content lines (one per file/page)
  366.         for(var ndx=0; ndx < top.sc2.length; ndx++) {
  367.  
  368.             // Put the cached title into glob_title
  369.                 glob_title = top.sc1[ndx];
  370.  
  371.             // Put the cached content line into glob_phrase
  372.                 glob_phrase = top.sc2[ndx];
  373.                 
  374.             if( maskArr[ndx] ) {
  375.             // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  376.                 if( top.isDblByte ) {
  377.                     hitsArr[ndx] = checkForHitsWordAgainstTitleAndLine2(w,ndx);
  378.                 }
  379.                 else {
  380.                     hitsArr[ndx] = checkForHitsWordAgainstTitleAndLine(w,ndx);
  381.                 }
  382.                 if( hitsArr[ndx] ) {
  383.                     hitAnywhere = 1;
  384.                 }
  385.             // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  386.             }
  387.         }
  388.     return hitAnywhere;
  389. }
  390. //---------------------------------------------------
  391. function checkForHitsWordAgainstTitleAndLine(w, lineNdx)
  392. {
  393.     var words;
  394.     var titleHitCnt = 0;
  395.     var contentHitCnt = 0;
  396.     var regex = new RegExp(w, "i");
  397.  
  398.     // TITLE .........................................
  399.         words = new Array();
  400.         words = glob_title.split(" ");
  401.  
  402.         // EXECUTE TITLE MATCH TEST
  403.         for( var ndx = 0; ndx < words.length; ndx++ ) {
  404.             if( w == words[ndx] ) {
  405.                 titleHitCnt += 100;
  406.                 break;
  407.             }
  408.         }
  409.  
  410.     // CONTENT .........................................
  411.         words = new Array();
  412.         words = glob_phrase.split(" ");
  413.  
  414.         // EXECUTE CONTENT MATCH TEST
  415.         if( regex.test(glob_phrase) ) {    // See if word is anywhere within the phrase first.
  416.             for( var ndx = 0; ndx < words.length; ndx++ ) {
  417.                 if( w == words[ndx] ) {
  418.                     contentHitCnt += getInstanceCount(lineNdx,ndx);
  419.                     break;
  420.                 }
  421.                 else if( w < words[ndx] ) { // If word is greater than the remaining words, leave
  422.                     break;
  423.                 }
  424.             }
  425.         }
  426.  
  427.     return titleHitCnt + contentHitCnt;
  428. }
  429. //---------------------------------------------------
  430. function checkForHitsWordAgainstTitleAndLine2(w, lineNdx)
  431. {
  432.     var titleHitCnt = 0;
  433.     var contentHitCnt = 0;
  434.  
  435.     // TITLE .........................................
  436.         if( glob_title.indexOf(w) != -1 ) {
  437.             titleHitCnt = 100;
  438.         }
  439.  
  440.     // CONTENT .........................................
  441.         contentHitCnt = indexesOf(glob_phrase,w);
  442.  
  443.     return titleHitCnt + contentHitCnt;
  444. }
  445. //---------------------------------------------------
  446. // checkTheInputString
  447. // 
  448. //  returns...
  449. //        empty string - if there is valid input to search
  450. //        message string - if there is NO VALID INPUT to search
  451. //---------------------------------------------------
  452. function checkTheInputString()
  453. {
  454.     var myArr = new Array();
  455.     var tempArr = new Array();
  456.     var foundStopOrShortWord = 0;
  457.     var ptn1 = /\d\D/;
  458.     var ptn2 = /\D\d/;
  459.  
  460.     handleWhitespaceRemoval();
  461.  
  462.     searchTerm = searchTerm.toLowerCase();
  463.  
  464.     searchTerm = filterTheChars(searchTerm);
  465.         
  466.     handleWhitespaceRemoval();
  467.  
  468.     if( searchTerm.length ) {
  469.         
  470.         // Split the searchTerm
  471.             tempArr = searchTerm.split(" ",100);
  472.             if(showInputStringAlerts){alert( "size of tempArr: " + tempArr.length );}
  473.  
  474.         // Handle periods
  475.             for( var ndx = 0; ndx < tempArr.length; ndx++ ) {
  476.                 if( tempArr[ndx].charCodeAt(0) == 46 ) {    // periods at the start of word
  477.                     //tempArr[ndx] = tempArr[ndx].substr(1); // NOTE: We don't want to do this. (e.g. ".txt")
  478.                 }
  479.                 if( tempArr[ndx].charCodeAt(tempArr[ndx].length-1) == 46 ) { // end of word
  480.                     tempArr[ndx] = tempArr[ndx].substr(0,tempArr[ndx].length-1);
  481.                 }
  482.             }
  483.             
  484.         // Do stopwords and shortwords removal
  485.             for( var ndx = 0; ndx < tempArr.length; ndx++ ) {
  486.                 var word = tempArr[ndx];
  487.                 if(showInputStringAlerts){alert( "Checking word: " + word );}
  488.                 
  489.                 if( ! top.sw[word] ) {
  490.                     if( word.length < 2 ) {
  491.                         foundStopOrShortWord = 1;
  492.                     }
  493.                     else if( (word.length > 2) || (ptn1.test(word) || ptn2.test(word)) ) {
  494.                         myArr[myArr.length] = tempArr[ndx];
  495.                     }
  496.                     else {
  497.                         foundStopOrShortWord = 1;
  498.                     }
  499.                 }
  500.                 else {
  501.                     foundStopOrShortWord = 1;
  502.                 }
  503.             }
  504.  
  505.         // Now reconstruct the searchTerm, based upon the 'myArr'
  506.             searchTerm = "";
  507.             for( var ndx = 0; ndx < myArr.length; ndx++ ) {
  508.                 searchTerm = searchTerm + myArr[ndx] + " ";
  509.             }
  510.  
  511.         handleWhitespaceRemoval();
  512.  
  513.         if(showInputStringAlerts){alert( "FINAL SEARCH TERM: *" + searchTerm + "*" );}
  514.             
  515.         if( foundStopOrShortWord && ! searchTerm.length ) {
  516.             return MSG_stopAndShortWords;
  517.         }
  518.         top.srch_input_massaged = searchTerm;
  519.         return "";
  520.     } 
  521.     else {
  522.         return MSG_noSearchTermEntered;
  523.     }
  524. }
  525. //---------------------------------------------------
  526. function checkTheInputString2()        // double-byte version
  527. {
  528.     var tempArr = new Array();
  529.  
  530.     handleWhitespaceRemoval();
  531.  
  532.     if( searchTerm.length ) {
  533.  
  534.         // Split the searchTerm
  535.             tempArr = searchTerm.split(" ",100);
  536.             if(showInputStringAlerts){alert( "number of search terms: " + tempArr.length );}
  537.  
  538.         // Now reconstruct the searchTerm, based upon the 'tempArr'
  539.             searchTerm = "";
  540.             for( var ndx = 0; ndx < tempArr.length; ndx++ ) {
  541.                 searchTerm = searchTerm + tempArr[ndx] + " ";
  542.             }
  543.             handleWhitespaceRemoval();
  544.  
  545. if(showInputStringAlerts){alert( "Massaged search term: " + searchTerm );}
  546.  
  547.         top.srch_input_massaged = searchTerm;
  548.         return "";
  549.     }
  550.     else {
  551.         return MSG_noSearchTermEntered;
  552.     }
  553. }
  554. //---------------------------------------------------
  555. function dispatch() {
  556.     if ( top.frames.length && is_ie && (top.srch_1_shot || top.srch_message.length) ){
  557.         doIEsearch();
  558.     }
  559. }
  560. //---------------------------------------------------
  561. function doIEsearch()
  562. {
  563.     var stStr = "";
  564.     
  565.     document.forms["search"].input.value = top.srch_input_verbatim;
  566.     
  567.     if( top.srch_message.length ) {
  568.         document.all.results.innerHTML = top.srch_message;
  569.         top.srch_message = "";
  570.     }
  571.     else if( top.srch_1_shot ) {
  572.         top.srch_1_shot = 0;
  573.         
  574.         searchTerm = top.srch_input_massaged;
  575.         checkForHits();    // Sets: 'matchesArrIndices' and 'matchesArrHits'
  576.  
  577.         if( matchesArrIndices.length ) {    // If there were matches/hits...
  578.             stStr = "<div class=\"form\">" + MSG_pagesContaining + top.srch_input_massaged + "</div>\n";
  579.             document.all.results.innerHTML = stStr + buildHtmlResultsStr();
  580.         }
  581.         else {
  582.             document.all.results.innerHTML = MSG_noPagesContain + top.srch_input_massaged;
  583.         }
  584.         searching_message.style.visibility="hidden";
  585.     }
  586.     top.srch_input_verbatim = "";
  587. }
  588. //---------------------------------------------------
  589. function doNNsearch()
  590. {
  591.     if( !top.frames.length || !(is_nav4up || is_gecko || is_khtml || is_opera) ) {return;}
  592.     
  593.     var ndxEnd;
  594.  
  595.     document.forms["search"].input.value = top.srch_input_verbatim; //"";
  596.     
  597.     if( top.srch_message.length ) {
  598.         document.write(top.srch_message);
  599.         top.srch_message = "";
  600.     }
  601.     else if( top.srch_1_shot ) {
  602.         top.srch_1_shot = 0;
  603.                 
  604.         searchTerm = top.srch_input_massaged;
  605.  
  606.         checkForHits();
  607.  
  608.         if( matchesArrIndices.length ) {
  609.  
  610.             document.write("<div class=\"form\">" + MSG_pagesContaining + top.srch_input_massaged + "</div>\n");
  611.  
  612.             ndxEnd = (matchesArrIndices.length > maxNumberOfShownSearchHits ) ? maxNumberOfShownSearchHits : matchesArrIndices.length;
  613.  
  614.             for(var ndx=0; ndx < ndxEnd; ndx++) {
  615.                 document.write(buildResultsStrOneLine(matchesArrIndices[ndx],matchesArrHits[ndx]));
  616.             }    
  617.         }
  618.         else {
  619.             document.write(MSG_noPagesContain + top.srch_input_massaged);
  620.         }
  621.         if (is_nav4) {
  622.             document.layers["searching_message"].visibility="hidden";
  623.         }
  624.     }
  625.     top.srch_input_verbatim = "";
  626.     if (is_nav4) {
  627.         window.stop();
  628.     }
  629. }
  630. //---------------------------------------------------
  631. function getInstanceCount( lineIndex, wordIndex )
  632. {
  633.     var instancesStr = top.instances[lineIndex];    // e.g. "1432931"
  634.     var ch = instancesStr.substr(wordIndex,1);
  635.     
  636.     return parseInt(ch);
  637. }
  638. //---------------------------------------------------
  639. function handleWhitespaceRemoval()
  640. {
  641.     var re_1 = /^\s/;
  642.     var re_2 = /\s$/;
  643.     var re_3 = /\s\s/;
  644.     var temp;
  645.  
  646.     // Remove leading whitespace
  647.         while( true ) {
  648.             temp = searchTerm.replace(re_1,"");
  649.             if( temp == searchTerm ) {
  650.                 break;
  651.             }
  652.             searchTerm = temp;
  653.         }
  654.     // Remove trailing whitespace
  655.         while( true ) {
  656.             temp = searchTerm.replace(re_2,"");
  657.             if( temp == searchTerm ) {
  658.                 break;
  659.             }
  660.             searchTerm = temp;
  661.         }
  662.     // Replace multiple contiguous spaces with a single space
  663.         while( searchTerm.search(re_3) != -1 ) {
  664.             temp = searchTerm.replace(re_3," ");
  665.             searchTerm = temp;
  666.         }
  667. }
  668. //--------------------------------------------------
  669. function isAcceptableChar(chrNdx)
  670. {
  671.     var acceptableChars = new Array( 32, 46, 95 );    // space, period, underscore
  672.     
  673.     for( var ndx = 0; ndx < acceptableChars.length; ndx++ ) {
  674.         if( chrNdx == acceptableChars[ndx] ) {
  675.             return true;
  676.         }
  677.     }
  678.     return false;
  679. }
  680. //--------------------------------------------------
  681. function indexesOf(str,ptn)
  682. {
  683.     var position = 0;
  684.     var hits = -1;
  685.     var start = -1;
  686.  
  687.     while( position != -1 ) {
  688.         position = str.indexOf(ptn, start+1);
  689.         hits += 1;
  690.         start = position;
  691.     }
  692.     return hits;
  693. }
  694. //--------------------------------------------------
  695. function filterTheChars(line)
  696. {
  697.     var retStr = "",tempStr;
  698.     var ch, chCode, retChr;
  699.     var ndx;
  700.     
  701.     for( ndx = 0; ndx < line.length; ndx++ ) {
  702.         ch = line.substr(ndx,1);
  703.         chCode = ch.charCodeAt(0);
  704.         
  705.         
  706.             if( (chCode >= 192) && (chCode <= 221) ) {    // Handle capital upper-ASCII characters
  707.                 chCode = chCode + 32;
  708.                 retChr = ASCII_to_char(chCode);
  709.             }
  710.             else if( withinAcceptableRanges(chCode) || isAcceptableChar(chCode) ) { // Acceptable characters
  711.                 retChr = ch;
  712.             }
  713.             else {
  714.                 tempStr = isLigatureChar(chCode);
  715.  
  716.                 if( tempStr.length ) {    // Handle ligature-style replacements
  717.                     retChr = tempStr;
  718.                 }
  719.                 else {        // Turn all else into space    
  720.                     retChr = " ";
  721.                 }
  722.             }
  723.  
  724.         // Grow the return string
  725.             retStr += retChr;
  726.     }
  727.     
  728.     return retStr;
  729. }
  730. //--------------------------------------------------
  731. function isLigatureChar(codeToCheck) {
  732.     var xlatTblNdx, code, replStr = "";
  733.  
  734.     for( xlatTblNdx = 0; xlatTblNdx < upperAsciiXlatTbl.length; xlatTblNdx+=2 ) {
  735.  
  736.         code = upperAsciiXlatTbl[xlatTblNdx];
  737.         if( code == codeToCheck ) {
  738.             replStr = upperAsciiXlatTbl[xlatTblNdx+1];
  739.             break;
  740.         }
  741.     }
  742.     
  743.     return replStr;
  744. }
  745. //--------------------------------------------------
  746. function respondToSearchButton() 
  747. {
  748.     var myStr;
  749.     
  750.     top.srch_input_verbatim = document.forms["search"].input.value;
  751.     searchTerm = document.forms["search"].input.value;
  752.     
  753.     if( top.isDblByte ) {
  754.         myStr = checkTheInputString2();
  755.     }
  756.     else {
  757.         myStr = checkTheInputString();    
  758.     }
  759.     
  760.     top.srch_message = myStr;
  761.     top.srch_1_shot = top.srch_message.length ? 0 : 1;
  762.     
  763.     if( (! myStr.length) && (! top.didDbLoad) ) {
  764.         document.location = "srch_fset.html";
  765.     }
  766.     else {
  767.         document.location = "search.html";
  768.     }
  769. }
  770. //---------------------------------------------------
  771. function strReplace(orig,src,dest)
  772. {
  773.     var startPos=0;
  774.     var matchPos = orig.indexOf(src,startPos);
  775.     var retLine="";
  776.     
  777.     while(matchPos != -1) {
  778.         retLine = retLine + orig.substring(startPos,matchPos) + dest;
  779.         startPos = matchPos+1;
  780.         matchPos = orig.indexOf(src,startPos);
  781.     }
  782.     if(! retLine.length) {return orig;}
  783.     else {return retLine+orig.substring(startPos,orig.length);}
  784. }
  785. //--------------------------------------------------
  786. function withinAcceptableRanges(chrNdx)
  787. {    
  788.     var acceptableRanges = new Array( "48-57","65-90","97-122","224-229","231-239","241-246","248-253","255-255");
  789.     
  790.     for( var ndx = 0; ndx < acceptableRanges.length; ndx++ ) {
  791.         var start_finish = new Array();
  792.  
  793.         start_finish = acceptableRanges[ndx].split("-");
  794.         
  795.         if( (chrNdx >= start_finish[0]) && (chrNdx <= start_finish[1]) ) {
  796.             return true;
  797.         }
  798.     }
  799.     return false;
  800. }
  801. //--------------------------------------------------
  802. function ASCII_to_char(num_in)
  803. {
  804.     var str_out = "";
  805.     var num_out = parseInt(num_in);
  806.     
  807.     num_out = unescape('%' + num_out.toString(16));
  808.     str_out += num_out;
  809.     
  810.     return unescape(str_out);
  811. }
  812. //--------------------------------------------------
  813. function writeNavigationCSS()
  814. {
  815.     if (is_gecko || is_khtml || (is_mac && is_ie5up) || is_ie6up)
  816.     {
  817.         document.write("<link href=\"navigation.css\" rel=\"stylesheet\" type=\"text/css\" />")
  818.     }
  819.     else
  820.     {
  821.         document.write("<link href=\"navigation_nav4.css\" rel=\"stylesheet\" type=\"text/css\" />")
  822.     }
  823. }
  824. //--------------------------------------------------
  825. function writeContentCSS()
  826. {
  827.     if (is_gecko || is_khtml || (is_mac && is_ie5up) || is_ie6up)
  828.     {
  829.         document.write("<link href=\"content.css\" rel=\"stylesheet\" type=\"text/css\" />")
  830.     }
  831.     else
  832.     {
  833.         document.write("<link href=\"content_nav4.css\" rel=\"stylesheet\" type=\"text/css\" />")
  834.     }
  835. }
  836.  
  837. //
  838. // JavaScript Browser Sniffer
  839. // Eric Krok, Andy King, Michel Plungjan Jan. 31, 2002
  840. // see http://www.webreference.com/ for more information
  841. //
  842. // This program is free software; you can redistribute it and/or modify
  843. // it under the terms of the GNU General Public License as published by
  844. // the Free Software Foundation; either version 2 of the License, or
  845. //  (at your option) any later version.
  846. //
  847. // please send any improvements to aking@internet.com and we'll
  848. // roll the best ones in
  849. //
  850. // adapted from Netscape's Ultimate client-side JavaScript client sniffer
  851. // and andy king's sniffer
  852. // Revised May 7 99 to add is.nav5up and is.ie5up (see below). (see below).
  853. // Revised June 11 99 to add additional props, checks
  854. // Revised June 23 99 added screen props - gecko m6 doesn't support yet - abk
  855. //                    converted to var is_ from is object to work everywhere
  856. // 990624 - added cookie forms links frames checks - abk
  857. // 001031 - ie4 mod 5.0 -> 5. (ie5.5 mididentified - abk)
  858. //          is_ie4 mod tp work with ie6+ - abk
  859. // 001120 - ns6 released, document.layers false, put back in
  860. //        - is_nav6 test added - abk
  861. // 001121 - ns6+ added, used document.getElementById, better test, dom-compl
  862. // 010117 - actual version for ie3-5.5 by Michel Plungjan
  863. // 010118 - actual version for ns6 by Michel Plungjan
  864. // 010217 - netscape 6/mz 6 ie5.5 onload defer bug docs - abk
  865. // 011107 - added is_ie6 and is_ie6up variables - dmr
  866. // 020128 - added link to netscape's sniffer, on which this is based - abk
  867. //          updated sniffer for aol4-6, ie5mac = js1.4, TVNavigator, AOLTV,
  868. //          hotjava
  869. // 020131 - cleaned up links, added more links to example object detection
  870. // 020131 - a couple small problems with Opera detection. First, when Opera
  871. //          is set to be compatible with other browsers it will contain their
  872. //          information in the userAgent strings. Thus, to be sure we have 
  873. //          Opera we should check for it before checking for the other bigs.
  874. //          (And make sure the others are !opera.) Also corrected a minor
  875. //          bug in the is_opera6up assignment.
  876. // 020214 - Added link for Opera/JS compatibility; added improvements for 
  877. //          windows xp/2000 id in opera and aol 7 id (thanks to Les
  878. //          Hill, Les.Hill@getronics.com, for the suggestion).
  879. // 020531 - Added N6/7 and moz identifiers. 
  880. // 020605 - Added mozilla guessing, Netscape 7 identification, and cleaner
  881. //          identification for Netscape 6. (this comment added after code 
  882. //          changes)
  883. // 020725 - Added is_gecko. -- dmr
  884. // 021205 - Added is_Flash and is_FlashVersion, based on Doc JavaScript code. 
  885. //          Added Opera 7 variables. -- dmr
  886. // 021209 - Added aol8. -- dmr
  887. // 030110 - Added is_safari, added 1.5 js designation for Opera 7. --dmr
  888. // 030128 - Added is_konq, per user suggestion (thanks to Sam Vilain).
  889. //          Removed duplicate Opera checks left over after last revision. - dmr
  890. //
  891. // Everything you always wanted to know about your JavaScript client
  892. // but were afraid to ask. Creates "is_" variables indicating:
  893. // (1) browser vendor:
  894. //     is_nav, is_ie, is_opera
  895. // (2) browser version number:
  896. //     is_major (integer indicating major version number: 2, 3, 4 ...)
  897. //     is_minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...)
  898. // (3) browser vendor AND major version number
  899. //     is_nav2, is_nav3, is_nav4, is_nav4up, is_nav5, is_nav5up, 
  900. //     is_nav6, is_nav6up, is_ie3, is_ie4, is_ie4up, is_ie5up, is_ie6...
  901. // (4) JavaScript version number:
  902. //     is_js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
  903. // (5) OS platform and version:
  904. //     is_win, is_win16, is_win32, is_win31, is_win95, is_winnt, is_win98
  905. //     is_os2
  906. //     is_mac, is_mac68k, is_macppc
  907. //     is_unix
  908. //        is_sun, is_sun4, is_sun5, is_suni86
  909. //        is_irix, is_irix5, is_irix6
  910. //        is_hpux, is_hpux9, is_hpux10
  911. //        is_aix, is_aix1, is_aix2, is_aix3, is_aix4
  912. //        is_linux, is_sco, is_unixware, is_mpras, is_reliant
  913. //        is_dec, is_sinix, is_freebsd, is_bsd
  914. //     is_vms
  915. //
  916. // based in part on 
  917. // http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
  918. // The Ultimate JavaScript Client Sniffer
  919. // and Andy King's object detection sniffer
  920. //
  921. // Note: you don't want your Nav4 or IE4 code to "turn off" or
  922. // stop working when Nav5 and IE5 (or later) are released, so
  923. // in conditional code forks, use is_nav4up ("Nav4 or greater")
  924. // and is_ie4up ("IE4 or greater") instead of is_nav4 or is_ie4
  925. // to check version in code which you want to work on future
  926. // versions. For DOM tests scripters commonly used the 
  927. // is_getElementById test, but make sure you test your code as
  928. // filter non-compliant browsers (Opera 5-6 for example) as some 
  929. // browsers return true for this test, and don't fully support
  930. // the W3C's DOM1.
  931. //
  932.  
  933.     // convert all characters to lowercase to simplify testing
  934.     var agt=navigator.userAgent.toLowerCase();
  935.     var appVer = navigator.appVersion.toLowerCase();
  936.  
  937.     // *** BROWSER VERSION ***
  938.  
  939.     var is_minor = parseFloat(appVer);
  940.     var is_major = parseInt(is_minor);
  941.  
  942.     var is_opera = (agt.indexOf("opera") != -1);
  943.     var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
  944.     var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
  945.     var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
  946.     var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
  947.     var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); // new 020128- abk
  948.     var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); // new 021205- dmr
  949.     var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);
  950.     var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); // new020128
  951.     var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6); // new021205 -- dmr
  952.  
  953.     // Note: On IE, start of appVersion return 3 or 4
  954.     // which supposedly is the version of Netscape it is compatible with.
  955.     // So we look for the real version further on in the string
  956.  
  957.     var iePos  = appVer.indexOf('msie');
  958.     if (iePos !=-1) {
  959.        is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
  960.        is_major = parseInt(is_minor);
  961.     }
  962.  
  963.     // ditto Konqueror
  964.                                       
  965.     var is_konq = false;
  966.     var kqPos   = agt.indexOf('konqueror');
  967.     if (kqPos !=-1) {                 
  968.        is_konq  = true;
  969.        is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));
  970.        is_major = parseInt(is_minor);
  971.     }                                 
  972.  
  973.     var is_getElementById   = (document.getElementById) ? "true" : "false"; // 001121-abk
  974.     var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // 001127-abk
  975.     var is_documentElement = (document.documentElement) ? "true" : "false"; // 001121-abk
  976.  
  977.     var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;
  978.     var is_khtml  = (is_safari || is_konq);
  979.  
  980.     var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;
  981.     var is_gver  = 0;
  982.     if (is_gecko) is_gver=navigator.productSub;
  983.  
  984.     var is_moz   = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
  985.                     (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
  986.                     (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
  987.                     (is_gecko) && 
  988.                     ((navigator.vendor=="")||(navigator.vendor=="Mozilla")));
  989.     if (is_moz) {
  990.        var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;
  991.        if(!(is_moz_ver)) {
  992.            is_moz_ver = agt.indexOf('rv:');
  993.            is_moz_ver = agt.substring(is_moz_ver+3);
  994.            is_paren   = is_moz_ver.indexOf(')');
  995.            is_moz_ver = is_moz_ver.substring(0,is_paren);
  996.        }
  997.        is_minor = is_moz_ver;
  998.        is_major = parseInt(is_moz_ver);
  999.     }
  1000.  
  1001.     var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
  1002.                 && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
  1003.                 && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)
  1004.                 && (!is_khtml) && (!(is_moz)));
  1005.  
  1006.     // Netscape6 is mozilla/5 + Netscape6/6.0!!!
  1007.     // Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0
  1008.     // Changed this to use navigator.vendor/vendorSub - dmr 060502   
  1009.     // var nav6Pos = agt.indexOf('netscape6');
  1010.     // if (nav6Pos !=-1) {
  1011.     if ((navigator.vendor)&&
  1012.         ((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&&
  1013.         (is_nav)) {
  1014.        is_major = parseInt(navigator.vendorSub);
  1015.        // here we need is_minor as a valid float for testing. We'll
  1016.        // revert to the actual content before printing the result. 
  1017.        is_minor = parseFloat(navigator.vendorSub);
  1018.     }
  1019.  
  1020.     var is_nav2 = (is_nav && (is_major == 2));
  1021.     var is_nav3 = (is_nav && (is_major == 3));
  1022.     var is_nav4 = (is_nav && (is_major == 4));
  1023.     var is_nav4up = (is_nav && is_minor >= 4);  // changed to is_minor for
  1024.                                                 // consistency - dmr, 011001
  1025.     var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
  1026.                           (agt.indexOf("; nav") != -1)) );
  1027.  
  1028.     var is_nav6   = (is_nav && is_major==6);    // new 010118 mhp
  1029.     var is_nav6up = (is_nav && is_minor >= 6) // new 010118 mhp
  1030.  
  1031.     var is_nav5   = (is_nav && is_major == 5 && !is_nav6); // checked for ns6
  1032.     var is_nav5up = (is_nav && is_minor >= 5);
  1033.  
  1034.     var is_nav7   = (is_nav && is_major == 7);
  1035.     var is_nav7up = (is_nav && is_minor >= 7);
  1036.  
  1037.     var is_ie   = ((iePos!=-1) && (!is_opera) && (!is_khtml));
  1038.     var is_ie3  = (is_ie && (is_major < 4));
  1039.  
  1040.     var is_ie4   = (is_ie && is_major == 4);
  1041.     var is_ie4up = (is_ie && is_minor >= 4);
  1042.     var is_ie5   = (is_ie && is_major == 5);
  1043.     var is_ie5up = (is_ie && is_minor >= 5);
  1044.     
  1045.     var is_ie5_5  = (is_ie && (agt.indexOf("msie 5.5") !=-1)); // 020128 new - abk
  1046.     var is_ie5_5up =(is_ie && is_minor >= 5.5);                // 020128 new - abk
  1047.     
  1048.     var is_ie6   = (is_ie && is_major == 6);
  1049.     var is_ie6up = (is_ie && is_minor >= 6);
  1050.  
  1051. // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
  1052.     // or if this is the first browser window opened.  Thus the
  1053.     // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
  1054.  
  1055.     var is_aol   = (agt.indexOf("aol") != -1);
  1056.     var is_aol3  = (is_aol && is_ie3);
  1057.     var is_aol4  = (is_aol && is_ie4);
  1058.     var is_aol5  = (agt.indexOf("aol 5") != -1);
  1059.     var is_aol6  = (agt.indexOf("aol 6") != -1);
  1060.     var is_aol7  = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1));
  1061.     var is_aol8  = ((agt.indexOf("aol 8")!=-1) || (agt.indexOf("aol8")!=-1));
  1062.  
  1063.     var is_webtv = (agt.indexOf("webtv") != -1);
  1064.     
  1065.     // new 020128 - abk
  1066.     
  1067.     var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
  1068.     var is_AOLTV = is_TVNavigator;
  1069.  
  1070.     var is_hotjava = (agt.indexOf("hotjava") != -1);
  1071.     var is_hotjava3 = (is_hotjava && (is_major == 3));
  1072.     var is_hotjava3up = (is_hotjava && (is_major >= 3));
  1073.  
  1074.     // end new
  1075.     
  1076.     // *** JAVASCRIPT VERSION CHECK ***
  1077.     // Useful to workaround Nav3 bug in which Nav3
  1078.     // loads <SCRIPT LANGUAGE="JavaScript1.2">.
  1079.     // updated 020131 by dragle
  1080.     var is_js;
  1081.     if (is_nav2 || is_ie3) is_js = 1.0;
  1082.     else if (is_nav3) is_js = 1.1;
  1083.     else if ((is_opera5)||(is_opera6)) is_js = 1.3; // 020214 - dmr
  1084.     else if (is_opera7up) is_js = 1.5; // 031010 - dmr
  1085.     else if (is_khtml) is_js = 1.5;   // 030110 - dmr
  1086.     else if (is_opera) is_js = 1.1;
  1087.     else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
  1088.     else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
  1089.     else if (is_nav5 && !(is_nav6)) is_js = 1.4;
  1090.     else if (is_hotjava3up) is_js = 1.4; // new 020128 - abk
  1091.     else if (is_nav6up) is_js = 1.5;
  1092.  
  1093.     // NOTE: In the future, update this code when newer versions of JS
  1094.     // are released. For now, we try to provide some upward compatibility
  1095.     // so that future versions of Nav and IE will show they are at
  1096.     // *least* JS 1.x capable. Always check for JS version compatibility
  1097.     // with > or >=.
  1098.  
  1099.     else if (is_nav && (is_major > 5)) is_js = 1.4;
  1100.     else if (is_ie && (is_major > 5)) is_js = 1.3;
  1101.     else if (is_moz) is_js = 1.5;
  1102.     
  1103.     // what about ie6 and ie6up for js version? abk
  1104.     
  1105.     // HACK: no idea for other browsers; always check for JS version 
  1106.     // with > or >=
  1107.     else is_js = 0.0;
  1108.     // HACK FOR IE5 MAC = js vers = 1.4 (if put inside if/else jumps out at 1.3)
  1109.     if ((agt.indexOf("mac")!=-1) && is_ie5up) is_js = 1.4; // 020128 - abk
  1110.     
  1111.     // Done with is_minor testing; revert to real for N6/7
  1112.     if (is_nav6up) {
  1113.        is_minor = navigator.vendorSub;
  1114.     }
  1115.  
  1116.     // *** PLATFORM ***
  1117.     var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
  1118.     // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
  1119.     //        Win32, so you can't distinguish between Win95 and WinNT.
  1120.     var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
  1121.  
  1122.     // is this a 16 bit compiled version?
  1123.     var is_win16 = ((agt.indexOf("win16")!=-1) ||
  1124.                (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
  1125.                (agt.indexOf("windows 16-bit")!=-1) );
  1126.  
  1127.     var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
  1128.                     (agt.indexOf("windows 16-bit")!=-1));
  1129.     
  1130.     var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));    // new 020128 - abk
  1131.     var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1) || (agt.indexOf("windows 2000")!=-1)); // 020214 - dmr
  1132.     var is_winxp = ((agt.indexOf("windows nt 5.1")!=-1) || (agt.indexOf("windows xp")!=-1)); // 020214 - dmr
  1133.  
  1134.     // NOTE: Reliable detection of Win98 may not be possible. It appears that:
  1135.     //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
  1136.     //       - On Mercury client, the 32-bit version will return "Win98", but
  1137.     //         the 16-bit version running on Win98 will still return "Win95".
  1138.     var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
  1139.     var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
  1140.     var is_win32 = (is_win95 || is_winnt || is_win98 ||
  1141.                     ((is_major >= 4) && (navigator.platform == "Win32")) ||
  1142.                     (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
  1143.  
  1144.     var is_os2   = ((agt.indexOf("os/2")!=-1) ||
  1145.                     (navigator.appVersion.indexOf("OS/2")!=-1) ||
  1146.                     (agt.indexOf("ibm-webexplorer")!=-1));
  1147.  
  1148.     var is_mac    = (agt.indexOf("mac")!=-1);
  1149.     if (is_mac) { is_win = !is_mac; } // dmr - 06/20/2002
  1150.     var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) ||
  1151.                                (agt.indexOf("68000")!=-1)));
  1152.     var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) ||
  1153.                                 (agt.indexOf("powerpc")!=-1)));
  1154.  
  1155.     var is_sun   = (agt.indexOf("sunos")!=-1);
  1156.     var is_sun4  = (agt.indexOf("sunos 4")!=-1);
  1157.     var is_sun5  = (agt.indexOf("sunos 5")!=-1);
  1158.     var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
  1159.     var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
  1160.     var is_irix5 = (agt.indexOf("irix 5") !=-1);
  1161.     var is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
  1162.     var is_hpux  = (agt.indexOf("hp-ux")!=-1);
  1163.     var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
  1164.     var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
  1165.     var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
  1166.     var is_aix1  = (agt.indexOf("aix 1") !=-1);
  1167.     var is_aix2  = (agt.indexOf("aix 2") !=-1);
  1168.     var is_aix3  = (agt.indexOf("aix 3") !=-1);
  1169.     var is_aix4  = (agt.indexOf("aix 4") !=-1);
  1170.     var is_linux = (agt.indexOf("inux")!=-1);
  1171.     var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
  1172.     var is_unixware = (agt.indexOf("unix_system_v")!=-1);
  1173.     var is_mpras    = (agt.indexOf("ncr")!=-1);
  1174.     var is_reliant  = (agt.indexOf("reliantunix")!=-1);
  1175.     var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
  1176.            (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
  1177.            (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
  1178.     var is_sinix = (agt.indexOf("sinix")!=-1);
  1179.     var is_freebsd = (agt.indexOf("freebsd")!=-1);
  1180.     var is_bsd = (agt.indexOf("bsd")!=-1);
  1181.     var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux ||
  1182.                  is_sco ||is_unixware || is_mpras || is_reliant ||
  1183.                  is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);
  1184.  
  1185.     var is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
  1186. // additional checks, abk
  1187.     var is_anchors = (document.anchors) ? "true":"false";
  1188.     var is_regexp = (window.RegExp) ? "true":"false";
  1189.     var is_option = (window.Option) ? "true":"false";
  1190.     var is_all = (document.all) ? "true":"false";
  1191. // cookies - 990624 - abk
  1192.     document.cookie = "cookies=true";
  1193.     var is_cookie = (document.cookie) ? "true" : "false";
  1194.     var is_images = (document.images) ? "true":"false";
  1195.     var is_layers = (document.layers) ? "true":"false"; // gecko m7 bug?
  1196. // new doc obj tests 990624-abk
  1197.     var is_forms = (document.forms) ? "true" : "false";
  1198.     var is_links = (document.links) ? "true" : "false";
  1199.     var is_frames = (window.frames) ? "true" : "false";
  1200.     var is_screen = (window.screen) ? "true" : "false";
  1201.  
  1202. // ]]-->
  1203.